<?php $this -> load -> view('adminx/header'); ?>
<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php $this -> load -> view('adminx/mune'); ?>
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- /.modal -->
			<h3 class="page-title"> <?php echo $title; ?> <small><?php echo $en; ?></small></h3>
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="/adminx">首页</a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="#"><?php echo $title; ?></a>
					</li>
				</ul>
			</div>
			<!-- END PAGE HEADER-->
			<div class="clearfix"></div>
			<div class="row">
				<div class="col-md-12 col-sm-12">
					<!-- BEGIN REGIONAL STATS PORTLET-->
					<div class="note note-success">
						<p>1，徽章是身份的象征，支持自定义；</p>
						<p>2，添加好后的徽章，通过发送链接的方式，邀请会员来领取；</p>
						<p>3，每一个徽章都对应一个独立的链接；</p>
					</div>
					<div class="portlet light ">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-share font-red-sunglo"></i>
								<span class="caption-subject font-red-sunglo bold uppercase"> <?php echo $title; ?>管理</span>
							</div>
							<div class="actions">
								<a class="btn btn-circle btn-icon-only blue" href="javascript:;" onclick="alert_ts('<?php echo $this -> config -> item('xt_ts'); ?>')"> <i class=" icon-bulb"></i> </a>
								<a class="btn btn-circle btn-icon-only green refresh" href="javascript:;" > <i class="icon-refresh"></i> </a>
								<a class="btn btn-circle btn-icon-only red" href="javascript:;"><i class="icon-trash"></i></a>
								<a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;"> </a>
							</div>
						</div>
						<div class="portlet-body">
							<div class="btn-toolbar margin-bottom-10">
								<form class="btn-toolbar" id="get_tbody" onkeydown="if(event.keyCode==13)return false;">
									<div class="portlet-input input-inline" style="margin-left: 10px;width: 150px;">
										<div class="input-icon right">
											<i class="icon-magnifier"></i>
											<input id="key" name="key" type="text" class="form-control" placeholder="search...">
										</div>
									</div>
									<div class="portlet-input input-inline">
										<select  id="page" name="page" class="form-control input-circle" style="width: 100px;">
											<option>1</option>
										</select>
									</div>
									<a class="btn purple" onclick="show_add()" href="javascript:;"><i class="fa  fa-pencil"></i> 添加<?php echo $title; ?></a>
								</form>
							</div>
							<div class=""></div>
							<div class="table-scrollable table-scrollable-borderless">
								<table class="table table-hover table-light">
									<thead>
										<tr>
											<th># </th>
											<th>LOGO</th>
											<th>名称</th>
											<th>已发放数量</th>
											<th>创建时间</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="tbody">
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!-- END REGIONAL STATS PORTLET-->
				</div>
			</div>
		</div>
	</div>
	
<div class="modal fade" id="show_add">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title">添加<?php echo $title; ?></h4>
			</div>
			<form role="form" id="addx" enctype="multipart/form-data">
			<div class="modal-body">
					<div class="form-group">
						<label>名称</label>
						<input class="form-control required" name="name" placeholder="名称"/>
					</div>
					<div class="form-group">
						<label>是否自动发放</label>
						<select class="form-control" name="is_send">
							<option value="1">是</option>
							<option value="2">否</option>
						</select>
					</div>
					<div class="form-group">
						<label>一次性奖励红包金额</label>
						<input class="form-control required number" name="je" placeholder=""/>
					</div>
					<div class="form-group">
						<label>订单提成百分比（百分比填写10，即10%，只针对大东家）</label>
						<input class="form-control required number" name="bfb" placeholder=""/>
					</div>

					<div class="form-group">
						<label>粉丝数量要求</label>
						<input class="form-control required number" name="yq_numb" placeholder="粉丝数量要求"/>
					</div>
					<div class="form-group">
						<label>销售数量要求</label>
						<input class="form-control required number" name="yq_je" placeholder="销售数量要求"/>
					</div>
					<div class="form-group">
						<label>要求的购买商品ID</label>
						<input class="form-control required number" name="yq_sp" placeholder="要求的购买商品ID"/>
					</div>
					<div class="form-group">
						<label>徽章LOGO</label>
						<?php echo $this -> form -> doform('pic', 'pic', '', ''); ?>
					</div>
					<div class="form-group">
						<label>简介</label>
						<textarea class="form-control required" style="height: 100px;" name="jj" placeholder="简介"></textarea>
					</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn default" data-dismiss="modal">
					<i class="fa fa-compress"></i>
					关 闭
				</button>
				<button type="submit" class="btn default blue">
					<i class="fa fa-send"></i>
					添加
				</button>
			</div>
			</form>
		</div>
	</div>
</div>

<div class="modal fade" id="show_up">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title">修改<?php echo $title; ?></h4>
			</div>
			<form role="form" id="upx" enctype="multipart/form-data">
			<div class="modal-body">
					<div class="form-group">
						<label>名称</label>
						<input class="form-control required" name="name" placeholder="名称"/>
					</div>
					<div class="form-group">
						<label>是否自动发放</label>
						<select class="form-control" name="is_send">
							<option value="1">是</option>
							<option value="2">否</option>
						</select>
					</div>
					<div class="form-group">
						<label>一次性奖励红包金额</label>
						<input class="form-control required number" name="je" placeholder=""/>
					</div>
					<div class="form-group">
						<label>订单提成百分比（百分比填写10，即10%，只针对大东家）</label>
						<input class="form-control required number" name="bfb" placeholder=""/>
					</div>
					<div class="form-group">
						<label>粉丝数量要求</label>
						<input class="form-control required number" name="yq_numb" placeholder="粉丝数量要求"/>
					</div>
					<div class="form-group">
						<label>销售数量要求</label>
						<input class="form-control required number" name="yq_je" placeholder="销售数量要求"/>
					</div>
					<div class="form-group">
						<label>要求的购买商品ID</label>
						<input class="form-control required number" name="yq_sp" placeholder="要求的购买商品ID"/>
					</div>
					<div class="form-group">
						<label>徽章LOGO</label>
						<?php echo $this -> form -> doform('pic', 'pic', '', ''); ?>
					</div>
					<div class="form-group">
						<label>简介</label>
						<input name="idx" id="upidx" value="0" type="hidden" />
						<textarea class="form-control required" style="height: 100px;" name="jj" placeholder="简介"></textarea>
					</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn default" data-dismiss="modal">
					<i class="fa fa-compress"></i>
					关 闭
				</button>
				<button type="submit" class="btn default blue">
					<i class="fa fa-send"></i>
					修改
				</button>
			</div>
			</form>
		</div>
	</div>
</div>	
	<!-- BEGIN QUICK SIDEBAR -->
	<?php $this -> load -> view('adminx/lt'); ?>
	<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php $this -> load -> view('adminx/footer'); ?>
<script>
    var _model='badge';
</script>
<script src="/mex/global/plugins/ajaxfileupload.js"></script>
<script src="/mex/lance/domodel.js"></script>